package com.twu.biblioteca.actions;

import com.twu.biblioteca.controllers.UserController;
import com.twu.biblioteca.models.User;

public class ViewMemberDetails implements Action {
    private UserController userController;

    public ViewMemberDetails(UserController userController) {
        this.userController = userController;
    }

    @Override
    public String displayName() {
        return "View member details";
    }

    @Override
    public void perform() {
        User user = userController.getCurrentUser();
        if (user != null) {
            System.out.println(user.getName());
            System.out.println(user.getEmail());
            System.out.println(user.getPhone());
        } else
            System.out.println("Please talk to a Librarian. Thank you.");
    }
}
